package pers.dzk.myplayer;

import java.io.File;
import java.util.Scanner;

/**
 * @author 丁泽凯
 */
public class Start {
    public Start(){
        //不要問我為什麼用控制台寫啟動器問就是沒時間
        System.out.println("\t\t\t\t\t启动器\n");
        boolean isLive = true;
        while (isLive) {
            System.out.println("---------视频列表---------");
            File[] files = new File("txt").listFiles();
            if(files != null){
                for (int i = 0; i < files.length;i++){
                    System.out.println((i+1)+"."+files[i].getName());
                }
            }
            System.out.println("\n\t\t选项\n1.播放\t\t\t2.导入");
            Scanner scanner = new Scanner(System.in);
            int index = scanner.nextInt();
            switch (index) {
                case 1:
                    System.out.println("请输入视频序号");
                    new Player(Factory.getName(files[scanner.nextInt()-1]));
                    break;
                case 2:
                    System.out.println("请输入图片地址");
                    Factory.videoToImageToString(new File(scanner.next()));
                    break;
            }
        }
    }
}
